import factory.FarmSystemManager;
import model.FarmMachine;
import monitor.EnvironmentMonitor;
import observer.RoadblockSensor;
import observer.SoilMoistureSensor;
import user.UserInputHandler;
import safety.SafetyController;
import command.RemoteController;
import command.AgriculturalDevice;
import factory.FarmEquipmentFactory;
import factory.TractorFactory;
import java.util.Scanner;

/**
 * 智能农机系统主类 - 专注于用户交互功能
 */
public class SmartFarmSystem {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 初始化系统核心组件
        FarmSystemManager manager = new FarmSystemManager();
        EnvironmentMonitor environmentMonitor = new EnvironmentMonitor();
        SafetyController safetyController = new SafetyController();
        SoilMoistureSensor soilMoistureSensor = new SoilMoistureSensor();
        RoadblockSensor roadblockSensor = new RoadblockSensor();

        // 创建设备（示例设备）
        manager.createEquipment("TRACTOR", "Tractor-001");
        manager.createEquipment("HARVESTER", "Harvester-001");
        manager.createEquipment("SEEDER", "Seeder-001");

        // 创建用户输入处理器并启动交互
        UserInputHandler inputHandler = new UserInputHandler(
                environmentMonitor,
                manager,
                safetyController,
                roadblockSensor
        );
        inputHandler.showMenu();

        scanner.close();
    }
}